import redis.clients.jedis.*;

import java.util.HashSet;
import java.util.Set;

public class RedisTest {
    public static void main(String[] args) {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        JedisPool jedisPool = new JedisPool(jedisPoolConfig,"192.168.164.128");
        Set<HostAndPort> hostAndPortSet = new HashSet<>();
        hostAndPortSet.add(new HostAndPort("192.168.164.128",7001));
        hostAndPortSet.add(new HostAndPort("192.168.164.128",7002));
        hostAndPortSet.add(new HostAndPort("192.168.164.128",7003));
        hostAndPortSet.add(new HostAndPort("192.168.164.128",7004));
        hostAndPortSet.add(new HostAndPort("192.168.164.128",7005));
        hostAndPortSet.add(new HostAndPort("192.168.164.128",7006));
        JedisCluster jc = new JedisCluster(hostAndPortSet,jedisPoolConfig);
        jc.set("testkey","testvalue");
        System.out.println(jc.get("testkey"));

    }
}
